package AJava1月.EJava第五周.练习题;

public class for求和02 {



    public static void main(String[] args) {
        //求1-100偶数

        /*int a = 2;

        for (int i = 1; i <=100;i++){
           // System.out.println(i);
            if (i%a == 0){
                System.out.println(i );
            }

        }*/




        //求1-100偶数的和
        int sum = 0;
        for (int i =1;i<=100;i++){
            if(i % 2 == 0){
                sum += i;
            }
        }
        System.out.println(sum);

    }
    }
